package com.group9.handinhand.service.so;

import org.apache.commons.lang.ArrayUtils;

import com.group9.handinhand.dao.model.EventAttender;
/**
 * Class for service of joining events.
 *
 */
public class EventAttenderSO extends AbstractBaseSO {
	
    private EventSO event;
	private UserSO user;
	/**
	 * converts event attender  model object
	 * @param ignoreProperties
	 * @return
	 */
	public EventAttender convertToModelObject(String... ignoreProperties) {
		EventAttender model = (EventAttender) convert(new EventAttender(),
				(String[]) ArrayUtils.addAll(ignoreProperties,new String[]{"event","user"}));
		model.setUser(this.user.convertToModelObject());
		model.setEvent(this.event.convertToModelObject(new String[]{"moderators", "posts","community","service","goods"}));
		return model;
	}

	public EventSO getEvent() {
		return event;
	}

	public void setEvent(EventSO event) {
		this.event = event;
	}

	public UserSO getUser() {
		return user;
	}

	public void setUser(UserSO user) {
		this.user = user;
	}

	@Override
	public String toString() {
		return "EventAttenderSO [event=" + event + ", user=" + user + "]";
	}
	
	
}
